home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 26 (Anniversary Edition)
/
Volume 26 [Anniversary Edition] - JOGO DISK .iso
/
DEPOSITO
/
REmovido
/
Esportes
/
681.swf
/
scripts
/
frame_22
/
DoAction.as
Wrap
Text File
|
2006-06-13
|
3KB
|
162 lines
function CalculateScore(x, y)
{
var radius;
var angle;
var score;
var multiplier;
x = _root.movBoard._x - x;
y = _root.movBoard._y - y;
angle = 57.29577951308232 * Math.atan(Math.abs(x) / Math.abs(y));
radius = Math.sqrt(Math.abs(x) * Math.abs(x) + Math.abs(y) * Math.abs(y));
if(0 < y)
{
if(x < 0)
{
if(0 < angle and 9 >= angle)
{
score = 20;
}
if(9 < angle and 27 >= angle)
{
score = 1;
}
if(27 < angle and 45 >= angle)
{
score = 18;
}
if(45 < angle and 63 >= angle)
{
score = 4;
}
if(63 < angle and 81 >= angle)
{
score = 13;
}
if(81 < angle and 90 >= angle)
{
score = 6;
}
}
else if(0 < x)
{
if(0 < angle and 9 >= angle)
{
score = 20;
}
if(9 < angle and 27 >= angle)
{
score = 5;
}
if(27 < angle and 45 >= angle)
{
score = 12;
}
if(45 < angle and 63 >= angle)
{
score = 9;
}
if(63 < angle and 81 >= angle)
{
score = 14;
}
if(81 < angle and 90 >= angle)
{
score = 11;
}
}
}
else if(y < 0)
{
if(x < 0)
{
if(0 < angle and 8 >= angle)
{
score = 3;
}
if(8 < angle and 27 >= angle)
{
score = 17;
}
if(27 < angle and 45 >= angle)
{
score = 2;
}
if(45 < angle and 63 >= angle)
{
score = 15;
}
if(63 < angle and 81 >= angle)
{
score = 10;
}
if(81 < angle and 90 >= angle)
{
score = 6;
}
}
else if(0 < x)
{
if(0 < angle and 8 >= angle)
{
score = 3;
}
if(8 < angle and 27 >= angle)
{
score = 19;
}
if(27 < angle and 45 >= angle)
{
score = 7;
}
if(45 < angle and 63 >= angle)
{
score = 16;
}
if(63 < angle and 81 >= angle)
{
score = 8;
}
if(81 < angle and 90 >= angle)
{
score = 11;
}
}
}
multiplier = 1;
if(radius >= 68 and 74 >= radius)
{
multiplier = 3;
}
else if(radius >= 110 and 118 >= radius)
{
multiplier = 2;
}
else if(118 < radius)
{
multiplier = 0;
}
else if(radius >= 0 and 5 >= radius)
{
multiplier = 1;
score = 50;
}
else if(5 < radius and 11 >= radius)
{
multiplier = 1;
score = 25;
}
LastRadius = radius;
score *= multiplier;
return score;
}
var runningTotal;
_root.objDarta.stop();
removeMovieClip(objDart1);
removeMovieClip(objDart2);
removeMovieClip(objDart3);
_root.objSliders.objSliderTop.slide = 1;
_root.objSliders.objSliderRight.slide = 0;
runningTotal = 0;
txtStatus = "";
stop();